package chenjun.mydatabindingdemo.bean;

import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;

import java.util.List;

/**
 * Created by n6 on 2016/9/29.
 */
public class JokeBean {

    /**
     * error_code : 0
     * reason : Success
     */

    private int error_code;
    private String reason;
    private ResultBean result;

    public int getError_code() {
        return error_code;
    }

    public void setError_code(int error_code) {
        this.error_code = error_code;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public ResultBean getResult() {
        return result;
    }

    public void setResult(ResultBean result) {
        this.result = result;
    }

    public static class ResultBean {

        private List<DataBean> data;

        public List<DataBean> getData() {
            return data;
        }

        public void setData(List<DataBean> data) {
            this.data = data;
        }

        public static class DataBean implements Parcelable {
            private String content;
            private String title;
            private String hashId;
            private int unixtime;
            private String updatetime;

            @Override
            public String toString() {
                return "DataBean{" +
                        "content='" + content + '\'' +
                        ", title='" + title + '\'' +
                        ", hashId='" + hashId + '\'' +
                        ", unixtime=" + unixtime +
                        ", updatetime='" + updatetime + '\'' +
                        '}';
            }

            public DataBean(){}

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public String getHashId() {
                return hashId;
            }

            public void setHashId(String hashId) {
                this.hashId = hashId;
            }

            public int getUnixtime() {
                return unixtime;
            }

            public void setUnixtime(int unixtime) {
                this.unixtime = unixtime;
            }

            public String getUpdatetime() {
                return updatetime;
            }

            public void setUpdatetime(String updatetime) {
                this.updatetime = updatetime;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeString(content);
                parcel.writeString(title);
                parcel.writeString(hashId);
                parcel.writeInt(unixtime);
                parcel.writeString(updatetime);
            }

            public static final Parcelable.Creator<DataBean> CREATOR = new Parcelable.Creator<DataBean>(){
                @Override
                public DataBean createFromParcel(Parcel parcel) {
                    return new DataBean(parcel);
                }

                @Override
                public DataBean[] newArray(int i) {
                    return new DataBean[i];
                }
            };

            public DataBean(Parcel parcel){
                content = parcel.readString();
                title = parcel.readString();
                hashId = parcel.readString();
                unixtime = parcel.readInt();
                updatetime = parcel.readString();
            }
        }
    }
}
